#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <errno.h>
int main()
{

    //
    int send_fd, size;
    struct sockaddr_in server_addr;
    send_fd = socket(AF_INET, SOCK_DGRAM, 0); // udp

    server_addr.sin_family = AF_INET;
    server_addr.sin_port = htons(8080);
    server_addr.sin_addr.s_addr = inet_addr("127.0.0.1");

    size = sendto(send_fd, "hello", 5, 0, (struct sockaddr *)&server_addr, sizeof(server_addr));
    printf("send size: %d\n", size);

    close(send_fd);

    return 0;
}